extends ../layout
block content
    div()
        nav#main-nav.navbar.navbar-default.navbar-static-top(role="navigation")
            div.container-fluid
                ul.nav.navbar-nav
                    if (admin)
                        li
                            p.navbar-text
                                span(data-bind="translate: 'WELCOME'")
                                span , #{user.displayName}
                        // ko foreach: navlinks
                        li
                            a(data-bind="attr: {href: $data.href, target: $data.target}")
                                span.glyphicon(data-bind="attr: {'class': $data.icon? 'glyphicon '+$data.icon:''}")
                                span(data-bind="if: $data.icon") &nbsp;
                                span(data-bind="translate: $data.titleKey")
                        // /ko
                    else
                        if (user.displayName)
                            p.navbar-text
                                span You entered as #{user.displayName} but you are not admin:&nbsp;
                                a(href="/auth/logout") Logout
                        else
                            p.navbar-text
                                a(href="/auth/google") Login
        div.app-view()
            include admin-posts
            include admin-misc
            include admin-edit-post
            include admin-files
            include admin-log
block specific
    if developmentMode
        script(src='/js/app-admin.js')
    else
        script(src='/js/app-admin.min.js')
